﻿@model sBlog.Net.Models.BlogPostPageViewModel

@{
    ViewBag.Title = string.Format("Posts by {0} || {1} || page {2}", Model.AuthorDisplayName, Model.BlogName.ToLower(), Model.CurrentPageNumber);
}

@Html.Partial("DisqusCounts", Model)

@if (!Model.Any)
{
    <div>there are no posts for this author.</div>
}

@foreach (var post in Model.Posts)
{
    @Html.Partial("Post", post)
}
<br />

<div class="post-pager">
    @if (Model.Any && Model.PreviousPageValid)
    {
        <div style="float: left">
            @Html.RouteLink("<< Previous Page", "AuthorPostsPaged", new {authorName = Model.AuthorName, pageNumber = Model.PreviousPageNumber}, new {@class = "link"})
        </div>
    }

    @if (Model.Any && Model.NextPageValid)
    {
        <div style="float: right">
            @Html.RouteLink("Next Page >>", "AuthorPostsPaged", new {authorName = Model.AuthorName, pageNumber = Model.NextPageNumber}, new {@class = "link"})
        </div>
    }
</div>
